﻿//-------------------------------------------------------------------------------------------
// <copyright file="StringExtensions.cs" company="Russell Wilkins">
//     Copyright (c) Russell Wilkins 2014. All Rights Reserved.
// </copyright>
// <author>Russell Wilkins</author>
// <license href="license.txt">
//     The use of this software is governed by the Microsoft Public License
//     which is included with this distribution.
// </license>
//-------------------------------------------------------------------------------------------
namespace Ripple.Helpers
{
    using System;

    public static class StringExtensions
    {
        public static bool ToBool(this string s)
        {
            return string.Compare(s, "success", StringComparison.InvariantCultureIgnoreCase) == 0;
        }

        public static double ToDateTime(this string s)
        {
            return double.Parse(s);
        }

        public static double ToDouble(this string s)
        {
            return double.Parse(s);
        }

        public static int ToInt(this string s)
        {
            return int.Parse(s);
        }

        public static long ToLong(this string s)
        {
            return long.Parse(s);
        }
    }
}